package fr.cephb.locustree.loaders;

import java.util.HashMap;
import java.util.Map;

import fr.cephb.locustree.MappedObject;

public class UCSCSnpCodingLoader
	extends AbstractLTStreamLoader
	{

	@Override
	protected boolean make(String[] token)
		{
		this.chromosome=token[1];
		this.mappedObject=new MappedObject(token[4], token[4], Integer.parseInt(token[2]), Integer.parseInt(token[3]));
		Map<String,Object> json= new HashMap<String,Object>();
		json.put("transcript", token[5]);
		json.put("frame", token[6]);
		json.put("alleleCount", token[7]);
		json.put("funcCodes", token[8]);
		json.put("alleles", token[9]);
		json.put("codons", token[10]);
		json.put("peptides", token[11]);
		this.mappedObject.setJSON(json);
		this.keywords.add(this.mappedObject.getName());
		this.keywords.add(token[5]);
		return true;
		}
	}
